package cn.kgc.springboot.service.impl;

import cn.kgc.springboot.entity.User;
import cn.kgc.springboot.mapper.HelloMapper;
import cn.kgc.springboot.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author 课工场
 * @date 2024/11/28
 * @description
 */
@Service
public class HelloServiceImpl implements HelloService {

    @Autowired
    private HelloMapper helloMapper;


    @Override
    public List<User> userList() {
        return helloMapper.selectUsers();
    }

    @Override
    public Map<String, Object> deleteUser(Integer id) {

        Integer  line =  helloMapper.deleteUser(id);

        HashMap<String, Object> result = new HashMap<>();
        result.put("code",0);
        result.put("message","delete ok");
        result.put("data",line);

        return result;
    }
}
